<%
  #File:    /app/views/manage/documents/_list_file_versions.rhtml
  #Author:  Andrew Stone
  #Created: 08.31.2006
%>

<div id="sub_container">
  <table>
    <thead>
      <tr>
        <td>Version</td>
        <td>Updated On</td>
        <td>Actions</td>
      </tr>
    </thead>
    <tbody>
    <%
      @document.document_version.each do |doc| %>
        <tr>
          <td class="data"><%=h(doc.version)%></td>
          <td class="data"><%=h(mmddyyyy(doc.updated_at))%></td>
          <td>
            <%
              links = []
              unless doc.id == @document.current_version.id
                links << secure_link_to("Make current",ca("/manage/documents","set_file_version",doc.id),:confirm => "Are you sure?") 
                links << secure_link_to("Delete",ca("/manage/documents","delete_file_version", doc.id),:confirm => "Are you sure?") 
              end
              if links.length > 0
            %>
                <%=secure_links(links)%>
            <%
              else
            %>
                No actions available for current version.
            <%
              end
            %>
          </td>
        </tr>
    <% 
      end %>
    </tbody>
  </table>
</div>

